﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;

namespace IHISCETeim.BLL
{
    public class WOITMController : BaseController
    {
        /// <summary>
        /// 入库操作，可支持批量入库
        /// </summary>
        /// <param name="ItemCodes">多物料请使用半角逗号隔开</param>
        /// <param name="OperateTypes">请使用半角逗号隔开</param>
        /// <param name="Quantitys">请使用半角逗号隔开</param>
        /// <param name="OperateUser"></param>
        /// <param name="OperateDocNums">请使用半角逗号隔开</param>
        /// <param name="OperateRemarks">请使用半角逗号隔开</param>
        /// <returns>-1表示失败,1表示成功</returns>
        public static int AddInputStockDetail(string ItemCodes, string OperateTypes, string Quantitys, string OperateUser, string OperateDocNums, string OperateRemarks)
        {
            return WOITMDAL.AddInputStockDetail(ItemCodes, OperateTypes, Quantitys, OperateUser, OperateDocNums, OperateRemarks);
        }

        /// <summary>
        /// 出库操作，可支持批量出库操作
        /// </summary>
        /// <param name="ItemCodes">多物料请使用半角逗号隔开</param>
        /// <param name="OperateTypes">请使用半角逗号隔开</param>
        /// <param name="Quantitys">请使用半角逗号隔开</param>
        /// <param name="OperateUser"></param>
        /// <param name="OperateDocNums">请使用半角逗号隔开</param>
        /// <param name="OperateRemarks">请使用半角逗号隔开</param>
        /// <returns>-1表示失败,1表示成功</returns>
        public static int AddOutStockDetail(string ItemCodes, string OperateTypes, string Quantitys, string OperateUser, string OperateDocNums, string OperateRemarks)
        {
            return WOITMDAL.AddOutStockDetail(ItemCodes, OperateTypes, Quantitys, OperateUser, OperateDocNums, OperateRemarks);
        }
        /// <summary>
        /// 根据物料号获取物料信息
        /// </summary>
        /// <param name="ItemCode"></param>
        /// <returns></returns>
        public static WOITMInfo GetByItemCode(string ItemCode)
        {
            return CBO.FillObject<WOITMInfo>(WOITMDAL.GetByItemCode(ItemCode));
        }
        /// <summary>
        /// 获取物料出入库明细
        /// </summary>
        /// <param name="SQLWhere"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="Sort"></param>
        /// <param name="TotalCount"></param>
        /// <returns></returns>
        public static DataTable GetDetailPagination(string SQLWhere, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return WOITMDAL.GetDetailPagination(SQLWhere, PageIndex, PageSize, Sort, ref TotalCount);
        }
        /// <summary>
        /// 获取物料列表
        /// </summary>
        /// <param name="SQLWhere"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="Sort"></param>
        /// <param name="TotalCount"></param>
        /// <returns></returns>
        public static DataTable GetPagination(string SQLWhere, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return WOITMDAL.GetPagination(SQLWhere, PageIndex, PageSize, Sort, ref TotalCount);
        }

        /// <summary>
        /// 更改物料库位，工位
        /// </summary>
        /// <param name="ItemCode"></param>
        /// <param name="U_KW"></param>
        /// <param name="U_GW"></param>
        /// <returns></returns>
        public static int Update(WOITMInfo obj)
        {
            return WOITMDAL.Update(obj);
        }

       
    }
}
